package r5.powtorka2;

import java.util.ArrayList;
import java.util.List;

public class Bin implements Runnable {

	@Override
	public void run() {

		
		List<Employee> staff = new ArrayList<Employee>(5);
		
		staff.add(new Employee("Janusz Trojanowski", 2500, 2005, 11, 25));
		staff.add(new Manager("Adam Goliszewski", 5000, 2000, 1, 20));
		
		for(Employee e : staff)
			System.out.println(e);
		
		Employee oryginal = new Employee("Johny Oryginal", 2000, 2000, 10, 1);
		Employee copy = oryginal;
		System.out.println(oryginal.equals(copy));
		copy.raisesalary(100);
		System.out.println(oryginal.equals(copy));
		System.out.println(oryginal.getSalary());
		System.out.println(copy.getSalary());
		Employee klon = null;
		try {
			klon = (Employee) oryginal.clone();
		} catch (CloneNotSupportedException e1) {
			e1.printStackTrace();
		}
		klon.raisesalary(200);
		System.out.println(oryginal);
		System.out.println(klon);
		
	}

}
